import 'package:json_annotation/json_annotation.dart';

part 'UserModel.g.dart';

// JsonSerializable
@JsonSerializable()
class UserModel {
  @JsonKey(name: "id")
  int? id;

  @JsonKey(name: 'userName')
  String userName;

  @JsonKey(name: 'userAvatar')
  String userAvatar;
  // 推广人数
  @JsonKey(name: 'popularizeCount')
  int popularizeCount;
  UserModel({
    this.id,
    this.userAvatar = "",
    this.userName = "登录/注册",
    this.popularizeCount = 0,
  });
  //不同的类使用不同的mixin即可
  factory UserModel.fromJson(Map<String, dynamic> json) =>
      _$UserModelFromJson(json);

  Map<String, dynamic> toJson() => _$UserModelToJson(this);
}
